<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试管理</title>
    <style>
        /* 全局样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            color: #333;
            margin: 0;
            padding: 0;
        }

        /* 顶部导航栏 */
        .navbar {
            background-color: #343a40;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
        }

        .navbar .navbar-brand {
            font-size: 1.5rem;
            font-weight: bold;
            color: white;
            text-decoration: none;
        }

        .navbar a {
            color: white;
            text-decoration: none;
            font-size: 1rem;
            margin-left: 1rem;
        }

        .navbar a:hover {
            text-decoration: underline;
        }

        /* 主容器 */
        .container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 1.5rem;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            font-size: 2rem;
            margin-bottom: 1rem;
            color: #343a40;
        }

        /* 表单样式 */
        form {
            margin-bottom: 2rem;
        }

        label {
            font-size: 1.25rem;
            color: #555;
            margin-bottom: 0.5rem;
            display: block;
        }

        select, input[type="text"] {
            width: 100%;
            padding: 0.5rem;
            font-size: 1rem;
            margin-bottom: 1rem;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        button {
            padding: 0.75rem 1.5rem;
            font-size: 1.25rem;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        button.btn-primary {
            background-color: #007bff;
            color: white;
        }

        button.btn-primary:hover {
            background-color: #0056b3;
        }

        button.btn-secondary {
            background-color: #6c757d;
            color: white;
        }

        button.btn-secondary:hover {
            background-color: #565e64;
        }
    </style>
</head>
<body>
    <div class="navbar">
        <a class="navbar-brand" href="#">考试管理</a>
        <a href="{{ url_for('teacher_dashboard', username=username) }}">返回控制台</a>
    </div>

    <div class="container">
        <h1>设置新考试</h1>

        <!-- 考试管理表单 -->
        <form method="POST" action="{{ url_for('exam_management', username=username) }}">
            <label for="class_name">选择班级:</label>
            <select id="class_name" name="class_name" required>
                <option value="" disabled selected>请选择班级</option>
                {% for class_name in classes %}
                <option value="{{ class_name }}">{{ class_name }}</option>
                {% endfor %}
            </select>

            <label for="exam_duration">考试时长 (分钟):</label>
            <input type="text" id="exam_duration" name="exam_duration" placeholder="请输入考试时长" required>

            <button type="submit" class="btn-primary">设置考试</button>
            <a href="{{ url_for('teacher_dashboard', username=username) }}" class="btn-secondary" style="text-decoration:none;padding:0.75rem 1.5rem;display:inline-block;">取消</a>
        </form>
    </div>
</body>
</html>
